<?php


namespace IDock\Insurance\JTIC;

use IDock\Http\Response;
use IDock\IDock\IDockInterface;
use IDock\Insurance\JTIC\Request\ConfigInquiryRequest;
use IDock\Insurance\JTIC\Request\EPolicyDownloadRequest;
use IDock\Insurance\JTIC\Request\NonCar\NonCarCollectionRequest;
use IDock\Insurance\JTIC\Request\NonCar\NonCarEPolicyDownRequest;
use IDock\Insurance\JTIC\Request\NonCar\NonCarInquiryInfoRequest;
use IDock\Insurance\JTIC\Request\NonCar\NonCarInquiryNoPreBuildRequest;
use IDock\Insurance\JTIC\Request\NonCar\NonCarInquiryRequest;
use IDock\Insurance\JTIC\Request\NonCar\NonCarRegisterRequest;
use IDock\Insurance\JTIC\Request\NonCarProductListRequest;
use IDock\Insurance\JTIC\Request\PolicyInfoRequest;
use IDock\Insurance\JTIC\Request\PolicyPaymentRequest;
use IDock\Insurance\JTIC\Request\PremiumInquiryRequest;
use IDock\Insurance\JTIC\Request\ProposalRecallRequest;
use IDock\Insurance\JTIC\Request\ProposalStatusRequest;
use IDock\Insurance\JTIC\Request\RenewalInquiryRequest;
use IDock\Insurance\JTIC\Request\UnderwritingRecallRequest;
use IDock\Insurance\JTIC\Request\UnderwritingRequest;
use IDock\Insurance\JTIC\Request\UploadFileRequest;
use IDock\Insurance\JTIC\Request\UploadResultQueryRequest;
use IDock\Insurance\JTIC\Request\VehicleModelRequest;
use IDock\Insurance\JTIC\Response\EPolicyDownloadResponse;
use IDock\Insurance\JTIC\Response\NonCar\NonCarCollectionResponse;
use IDock\Insurance\JTIC\Response\NonCar\NonCarEPolicyDownResponse;
use IDock\Insurance\JTIC\Response\NonCar\NonCarInquiryNoPreBuildResponse;
use IDock\Insurance\JTIC\Response\NonCar\NonCarInquiryResponse;
use IDock\Insurance\JTIC\Response\NonCarProductListResponse;
use IDock\Insurance\JTIC\Response\PolicyPaymentResponse;
use IDock\Insurance\JTIC\Response\PremiumInquiryResponse;
use IDock\Insurance\JTIC\Response\ProposalRecallResponse;
use IDock\Insurance\JTIC\Response\ProposalStatusResponse;
use IDock\Insurance\JTIC\Response\RenewalInquiryResponse;
use IDock\Insurance\JTIC\Response\UnderwritingRecallResponse;
use IDock\Insurance\JTIC\Response\UnderwritingResponse;
use IDock\Insurance\JTIC\Response\UploadFileResponse;
use IDock\Insurance\JTIC\Response\UploadResultQueryResponse;
use IDock\Insurance\JTIC\Response\VehicleActualValueResponse;
use IDock\Insurance\JTIC\Response\VehicleModelResponse;
use IDock\Printer\NonCar\NonCarInquiryPrinter;
use IDock\Printer\NonCar\NonCarInquirySinglePrinter;
use IDock\Printer\PremiumUnderwritingPrinter;
use IDock\Visitor\EPolicyDownloadVisitor;
use IDock\Visitor\NonCar\NonCarInquiryVisitor;
use IDock\Visitor\NonCar\NonCarProductListVisitor;
use IDock\Visitor\NonCar\NonCarProductVisitor;
use IDock\Visitor\PolicyInfoVisitor;
use IDock\Visitor\PolicyPaymentVisitor;
use IDock\Visitor\Premium\PremiumInquiryVisitor;
use IDock\Visitor\ProposalRecallVisitor;
use IDock\Visitor\ProposalStatusVisitor;
use IDock\Visitor\RenewalInquiryVisitor;
use IDock\Visitor\UnderwritingRecallVisitor;
use IDock\Visitor\UploadFileVisitor;
use IDock\Visitor\VehicleActualValueVisitor;
use IDock\Visitor\VehicleModelVisitor;

class JTICConstruct extends Builder implements IDockInterface
{
    public $config = [];

    public function __construct($config)
    {
        $this->config = $config;
        $this->appId = $config['appId'] ?? '';
        $this->appKey = $config['appKey'] ?? '';
    }

    public function configInquiry()
    {
        $request = new ConfigInquiryRequest();

        /*** @var VehicleModelResponse $response */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 续保查询
     * @param RenewalInquiryVisitor $renewalInquiryVisitor
     * @return RenewalInquiryResponse
     */
    public function renewalInquiry(RenewalInquiryVisitor $renewalInquiryVisitor): RenewalInquiryResponse
    {
        throw new \Exception('续保查询---未实现的接口');
    }

    /**
     * 车型查询
     * @param VehicleModelVisitor $vehicleModelVisitor
     * @return VehicleModelResponse
     */
    public function vehicleModel(VehicleModelVisitor $vehicleModelVisitor): VehicleModelResponse
    {
        $request = new VehicleModelRequest();
        $request->setVisitor($vehicleModelVisitor);

        /*** @var VehicleModelResponse $response */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 车辆实际价格
     * @param VehicleActualValueVisitor $vehicleActualValueVisitor
     * @return VehicleActualValueResponse
     */
    public function vehicleActualValue(VehicleActualValueVisitor $vehicleActualValueVisitor): VehicleActualValueResponse
    {
        $response = new VehicleActualValueResponse();
        $response->setCode(200);
        $response->printerInit();
        return $response;
    }

    /**
     * 询价前置
     * @param PremiumInquiryVisitor $premiumInquiryVisitor
     * @return mixed|void
     */
    public function preInquiry(PremiumInquiryVisitor $premiumInquiryVisitor)
    {
        throw new \Exception('询价前置---未实现的接口');
    }

    public function validateCar(PremiumInquiryVisitor $premiumInquiryVisitor)
    {
        // TODO: Implement validateCar() method.
    }

    /**
     * 询价
     * @param PremiumInquiryVisitor $premiumInquiryVisitor
     * @return Response
     */
    public function premiumInquiry(PremiumInquiryVisitor $premiumInquiryVisitor): Response
    {
        $request = new PremiumInquiryRequest;
        $request->setVisitor($premiumInquiryVisitor);

        //global $testResponse;
        /*$GLOBALS['testResponse'] = '<?xml version="1.0" encoding="UTF-8"?><Packet>  <Head>    <RequestType>V00</RequestType>    <SerialNo>3cdb840de54c531dde9ef02bf75305421e7bb40f</SerialNo>    <ResponseCode>0</ResponseCode>    <ErrorCode>0000</ErrorCode>    <ErrorMessage>成功</ErrorMessage>  </Head><Body><TotalPrem>4118.52</TotalPrem><TotalSumlimit>2290090.0</TotalSumlimit><CHDRiskInfo>{"CEngNo":"17600405","TCrtTm":1706758896000,"cpkid":"ff8080818d44e861018d62c1fa4639d0","cstatus":"1","divisorStatus":"1","dptCde":"51","highRisk":"-1","highRiskStatus":"0","plateNo":"川A31W0K","priConsistencyFlag":"1","priScore":"11.80","priTranche":"18","status":"1","type":"B2","vin":"LS4AAB2RXHE857189"}</CHDRiskInfo><TotalPremAndTax>4418.52</TotalPremAndTax><CI><CQueryNo>599510803602024000015</CQueryNo><Prem>1100.0</Prem><Tax>300.0</Tax><RenewFlag>0</RenewFlag><DPrem>1100.0</DPrem><Discount>1.0</Discount><DupFlag>0</DupFlag><TaxDetail><AnnualTaxDue>300.0</AnnualTaxDue><SumTaxDefault>0.0</SumTaxDefault><SumOverdue>0.0</SumOverdue></TaxDetail><SpecialContact>四川保险业消费者权益保护中心维权热线：028-841-12378。@本车险相关信息将由本公司共享至四川省保险行业协会，用于（且仅用于）行业与交管等政府部门进行信息共享，用于风险防范、社会管理等目的。@因履行本保险合同发生的争议，除条款约定的合同争议解决方式外，还可向四川保险业消费者权益保护中心申请调解。@温馨提示：尊敬的客户，投保次日起，您可通过本网站、客服电话、营业网点核实保单及理赔等信息。若对查询结果有异议，请联系本公司。联系方式：网址：http://www.e-JTIC.com 电话：95544。@2023年3季度，我司综合偿付能力充足率为271.12%，符合监管要求。2023年2季度，我司风险综合评级（分类监管）为B 。 @本保单保险费为含税金额，其中不含税保险费**元、增值税**元。</SpecialContact><CIExpectedLossRatio>0.5127</CIExpectedLossRatio><BIExpectedLossRatio>0.0</BIExpectedLossRatio><TExpectedLossRatio>0.5127</TExpectedLossRatio><PreUndrMsg>四川细则库：非营业客车单交业务，转人工;</PreUndrMsg><NewFuelVhlFlag>0</NewFuelVhlFlag><ChangedVehlValue>20090</ChangedVehlValue><DRUBIType></DRUBIType><DRUBIScore></DRUBIScore><JTICVhlScore></JTICVhlScore><NewImageID>2024020116312200000454</NewImageID></CI><BI><QueryPastDate></QueryPastDate><RenewFlag>0</RenewFlag><BQueryNo>599510803662024000017</BQueryNo><BPremium>3018.52</BPremium><BSumlimit>2090090.0</BSumlimit><CoverageItem><CoverageCode>0101200</CoverageCode><Premium>1345.1</Premium><Sumlimit>20090.0</Sumlimit><DeductPrem>0.0</DeductPrem></CoverageItem><CoverageItem><CoverageCode>0101600</CoverageCode><Premium>1477.78</Premium><Sumlimit>2000000.0</Sumlimit><DeductPrem>0.0</DeductPrem></CoverageItem><CoverageItem><CoverageCode>0101701</CoverageCode><Premium>40.36</Premium><Sumlimit>10000.0</Sumlimit><DeductPrem>0.0</DeductPrem></CoverageItem><CoverageItem><CoverageCode>0101702</CoverageCode><Premium>155.28</Premium><Sumlimit>60000.0</Sumlimit><DeductPrem>0.0</DeductPrem></CoverageItem><Discount>1.5</Discount><BDPremium>2012.35</BDPremium><NCD>1.0</NCD><DupFlag>0</DupFlag><PlateTransferType></PlateTransferType><SpecialContact>2023年3季度，我司综合偿付能力充足率为271.12%，符合监管要求。2023年2季度，我司风险综合评级（分类监管）为B 。 @本车险相关信息将由本公司共享至四川省保险行业协会，用于（且仅用于）行业与交管等政府部门进行信息共享，用于风险防范、社会管理等目的。@四川保险业消费者权益保护中心维权热线：028-841-12378。@因履行本保险合同发生的争议，除条款约定的合同争议解决方式外，还可向四川保险业消费者权益保护中心申请调解。@温馨提示：尊敬的客户，投保次日起，您可通过本网站、客服电话、营业网点核实保单及理赔等信息。若对查询结果有异议，请联系本公司。联系方式：网址：http://www.e-JTIC.com 电话：95544。@本保单保险费为含税金额，其中不含税保险费**元、增值税**元。@经保险双方协商同意，本车投保人以非营业用车性质向保险人投保，若本车用于营业用途发生事故，保险人对事故造成的损失不承担赔偿责任。</SpecialContact><NCDFlag>0</NCDFlag><AutoPriceDiscount>1.5</AutoPriceDiscount><CIExpectedLossRatio>1.3173</CIExpectedLossRatio><BIExpectedLossRatio>0.5125</BIExpectedLossRatio><TExpectedLossRatio>0.7274</TExpectedLossRatio><ReInsureItem></ReInsureItem><VhlSimpleFreeRate>0.0</VhlSimpleFreeRate><AdviceDiscount>1.5</AdviceDiscount><PreUndrMsg>交强险提示信息：自核通过！ 商业险提示信息：单车核保通则库_总部：转保脱保业务，投保车身划痕险或车损险或新增设备或车轮单独损失，或任一组合时，需验车; 单车核保通则库_总部：非营业外地车控制，转人工;</PreUndrMsg><NewFuelVhlFlag>0</NewFuelVhlFlag><ChangedVehlValue>20090</ChangedVehlValue><ChargingPostInfoList></ChargingPostInfoList><DRUBIType></DRUBIType><DRUBIScore></DRUBIScore><JTICVhlScore></JTICVhlScore><NewImageID>2024020116312200000454</NewImageID></BI><MFileList><MFileItem><FileType>1002</FileType><FileDesc>投保人身份证</FileDesc></MFileItem><MFileItem><FileType>1003</FileType><FileDesc>被保人身份证</FileDesc></MFileItem><MFileItem><FileType>1004</FileType><FileDesc>行驶证</FileDesc></MFileItem><MFileItem><FileType>1005</FileType><FileDesc>验车照</FileDesc></MFileItem><MFileItem><FileType>1006</FileType><FileDesc>验车报告</FileDesc></MFileItem><MFileItem><FileType>1010</FileType><FileDesc>上年保单证明资料</FileDesc></MFileItem></MFileList></Body></Packet>';*/

        //车险询价
        /*** @var PremiumInquiryResponse $mainResponse */
        $mainResponse = $this->execute($request);

        if (!$mainResponse->isSuccess() or !$mainResponse->printer->success) {
            return $mainResponse;
        }

        $mainResponse->buildCoverage($premiumInquiryVisitor->getVehicleVisitor()->isNewEnergy, $premiumInquiryVisitor->getCoverageVisitorList());

        if (!$mainResponse->isSuccess()) {
            return $mainResponse;
        }

        if ($premiumInquiryVisitor->getNonCarInquiryVisitor()->getNonCarList()) {
            //非车数据回填
            $nonCarInquiryPrinter = new NonCarInquiryPrinter();
            $totalPremium = 0;
            foreach ($premiumInquiryVisitor->getNonCarInquiryVisitor()->getNonCarList() as $item) {
                /*** @var $item NonCarProductVisitor */
                $single = new NonCarInquirySinglePrinter();
                $single->premium = $item->premium;
                $single->planCode = $item->planCode;
                $single->productCode = $item->productCode;
                $single->statusCode = 'success';

                $totalPremium += $single->premium * $item->insuredNum;
                $nonCarInquiryPrinter->noCarInquirySingleAppend($single);
            }
            $nonCarInquiryPrinter->totalPremium = $totalPremium;

            $mainResponse->printer->nonCarInquiryPrinter = $nonCarInquiryPrinter;

            return $mainResponse;
        }

        return $mainResponse;
    }

    /**
     * 核保
     * @param PremiumInquiryVisitor $premiumInquiryVisitor
     * @return Response
     */
    public function underwriting(PremiumInquiryVisitor $premiumInquiryVisitor): Response
    {
        $request = new UnderwritingRequest();
        $request->setVisitor($premiumInquiryVisitor);
//global $testResponse;
//$testResponse = '';
        /*** @var UnderwritingResponse $mainResponse */
        $mainResponse = $this->execute($request);

        if (!$mainResponse->isSuccess()) {
            return $mainResponse;
        }

        if ($premiumInquiryVisitor->getNonCarUnderwritingVisitor()->getNonCarList()) {
            //非车投保单号预生成
            //非车详细信息登记
//            return $this->JTICNonCarInquiryNoPreBuild($premiumInquiryVisitor, $mainResponse);
        }
        if($mainResponse->printer->inquiryNo && !empty($premiumInquiryVisitor->getFileList())){
            //上传文件
            $uploadRequest = new UploadFileRequest();
            $upVisitor = new UploadFileVisitor();
            $upVisitor->fileList = $premiumInquiryVisitor->getFileList();
            $upVisitor->argc = $premiumInquiryVisitor->getExtInfoVisitor()->argc;
            $upVisitor->inquiryNo = $mainResponse->printer->inquiryNo;
            $uploadRequest->setVisitor($upVisitor);
            /*** @var UploadFileResponse $response */
            $this->execute($uploadRequest);
        }

        return $mainResponse;
    }

    /**
     * 核保撤回
     * @param ProposalRecallVisitor $revokeVisitor
     * @return ProposalRecallResponse
     */
    public function proposalRecall(ProposalRecallVisitor $revokeVisitor): ProposalRecallResponse
    {
        $request = new ProposalRecallRequest();
        $request->setVisitor($revokeVisitor);

        /*** @var ProposalRecallResponse $response */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 人工核保撤回
     * @param UnderwritingRecallVisitor $recallVisitor
     * @return mixed|void
     */
    public function underwritingRecall(UnderwritingRecallVisitor $recallVisitor)
    {
        throw new \Exception('人工核保撤回---未实现的接口');
    }


    /**
     * 文件上传
     * @param UploadFileVisitor $uploadFileVisitor
     * @return UploadFileResponse
     */
    public function uploadFile(UploadFileVisitor $uploadFileVisitor): UploadFileResponse
    {
        return new UploadFileResponse(200);
    }


    /**
     * 支付
     * @param PolicyPaymentVisitor $paymentVisitor
     * @return PolicyPaymentResponse
     */
    public function policyPayment(PolicyPaymentVisitor $paymentVisitor): PolicyPaymentResponse
    {
        $request = new PolicyPaymentRequest();
        $request->setVisitor($paymentVisitor);

        /*** @var PolicyPaymentResponse $response */
        $response = $this->execute($request);
        return $response;
    }


    /**
     * 投保单状态查询
     * @param ProposalStatusVisitor $proposalStatusVisitor
     * @return ProposalStatusResponse
     */
    public function proposalStatus(ProposalStatusVisitor $proposalStatusVisitor): ProposalStatusResponse
    {
        $request = new ProposalStatusRequest();
        $request->setVisitor($proposalStatusVisitor);

        /*** @var ProposalStatusResponse $response */
        $response = $this->execute($request);
        return $response;
    }


    /**
     * 电子保单下载
     * @param EPolicyDownloadVisitor $EPolicyVisitor
     * @return EPolicyDownloadResponse
     */
    public function EPolicyDownload(EPolicyDownloadVisitor $EPolicyVisitor): EPolicyDownloadResponse
    {
        $request = new EPolicyDownloadRequest();
        $request->setVisitor($EPolicyVisitor);

        /*** @var EPolicyDownloadResponse $response */
        $response = $this->execute($request);
        return $response;
    }


    /**
     * 保单状态查询
     * @param PolicyInfoVisitor $policyInfoVisitor
     * @return mixed|void
     */
    public function policyInfo(PolicyInfoVisitor $policyInfoVisitor)
    {
        $request = new PolicyInfoRequest();
        $request->setVisitor($policyInfoVisitor);

        $response = $this->execute($request);
        return $response;
    }

    /**
     * 非车产品
     * @param NonCarProductListVisitor $nonCarProductListVisitor
     * @return NonCarProductListResponse
     */
    public function nonCarProductList(NonCarProductListVisitor $nonCarProductListVisitor): Response
    {
        $request = new NonCarProductListRequest();
        $request->setVisitor($nonCarProductListVisitor);
//global $testResponse;
//$testResponse = '<xml encoding="utf-8"><returnCode>0</returnCode><returnMsg><![CDATA[通信成功]]></returnMsg><sign>042e67e494c0c580438e889807f2fe34</sign><bizContent><![CDATA[<Packet><InterfaceMsg><ErrorCode>0000</ErrorCode><ErrorMessage>成功</ErrorMessage></InterfaceMsg><ProjectACCList><ProjectItem><ProjectType>1</ProjectType><ProjectCode>YWQGWX04001</ProjectCode><ProjectName>个人驾乘意外险（经济版）</ProjectName><PlanPremium>100.00</PlanPremium><PlanAmount>260000.00</PlanAmount><Amount>260000</Amount><SpecContent>&lt;p&gt;sadfadf&lt;/p&gt;</SpecContent><CoverageList><CoverageItem><CoverageType>1</CoverageType><CoverageCode>YW001001</CoverageCode><CoverageName>交通工具意外伤害保险</CoverageName><LiabilityCode>ZYW0005</LiabilityCode><LiabilityName>交通意外身故/残疾（乘坐非营运性质的机动车）</LiabilityName><PlanCoverageAmount>250000.00</PlanCoverageAmount><CoverageAmount>250000</CoverageAmount></CoverageItem><CoverageItem><CoverageType>1</CoverageType><CoverageCode>YW001001</CoverageCode><CoverageName>交通工具意外伤害保险</CoverageName><LiabilityCode>ZYW0004</LiabilityCode><LiabilityName>交通意外身故/残疾（驾驶非营运性质的机动车）</LiabilityName><PlanCoverageAmount>250000.00</PlanCoverageAmount><CoverageAmount>250000</CoverageAmount></CoverageItem><CoverageItem><CoverageType>0</CoverageType><CoverageCode>JK005001</CoverageCode><CoverageName>附加意外伤害医疗保险</CoverageName><LiabilityCode>ZJK0001</LiabilityCode><LiabilityName>意外医疗</LiabilityName><PlanCoverageAmount>10000.00</PlanCoverageAmount><CoverageAmount>10000</CoverageAmount></CoverageItem></CoverageList></ProjectItem><ProjectItem><ProjectType>1</ProjectType><ProjectCode>YWQGCX04003</ProjectCode><ProjectName>个人驾乘意外伤害保险2</ProjectName><PlanPremium>180.00</PlanPremium><PlanAmount>509000.00</PlanAmount><Amount>509000</Amount><SpecContent>1、驾驶或乘坐家庭自用车期间的意外伤害医疗：在保险期间内，被保险人遭受主险责任范围内的意外伤害并在中华人民共和国境内（不含港、澳、台地区）二级（含）以上或保险人认可的医疗机构治疗，由此发生符合当地社会基本医疗保险规定可以报销的合理且必要的医疗费用，保险人按“（每次意外合理医疗费用-100元 ）× 80%”给付意外伤害医疗保险金；2、驾驶或乘坐家庭自用车期间的意外伤害住院津贴：在保险期间内，被保险人遭受主险责任范围内的意外伤害并在中华人民共和国境内（不含港、澳、台地区）二级（含）以上或保险人认可的其它医疗机构住院治疗，保险人按“（每次实际住院天数-3天）×50元”给付住院津贴保险金。单次给付天数最高不超过90天，累计给付天数最高不超过180天；3、特别提醒：由于被保险人驾驶机动车超载、超速、超限引起的意外伤害，被保险人酒后驾驶、无有效驾驶证驾驶或者驾驶无有效行驶证的机动车期间引起的意外伤害，保险人不承担给付保险金责任；4、适用条款：《交通工具意外伤害保险条款》、《附加意外伤害医疗保险条款》。</SpecContent><CoverageList><CoverageItem><CoverageType>1</CoverageType><CoverageCode>YW001001</CoverageCode><CoverageName>交通工具意外伤害保险</CoverageName><LiabilityCode>ZYW0004</LiabilityCode><LiabilityName>交通意外身故/残疾（驾驶非营运性质的机动车）</LiabilityName><PlanCoverageAmount>500000.00</PlanCoverageAmount><CoverageAmount>500000</CoverageAmount></CoverageItem><CoverageItem><CoverageType>1</CoverageType><CoverageCode>YW001001</CoverageCode><CoverageName>交通工具意外伤害保险</CoverageName><LiabilityCode>ZYW0005</LiabilityCode><LiabilityName>交通意外身故/残疾（乘坐非营运性质的机动车）</LiabilityName><PlanCoverageAmount>50000.00</PlanCoverageAmount><CoverageAmount>50000</CoverageAmount></CoverageItem><CoverageItem><CoverageType>0</CoverageType><CoverageCode>JK005001</CoverageCode><CoverageName>附加意外伤害医疗保险</CoverageName><LiabilityCode>ZJK0001</LiabilityCode><LiabilityName>意外医疗</LiabilityName><PlanCoverageAmount>9000.00</PlanCoverageAmount><CoverageAmount>9000</CoverageAmount></CoverageItem></CoverageList></ProjectItem><ProjectItem><ProjectType>1</ProjectType><ProjectCode>YWQGCX04004</ProjectCode><ProjectName>个人驾乘意外伤害保险3</ProjectName><PlanPremium>380.00</PlanPremium><PlanAmount>518000.00</PlanAmount><Amount>518000</Amount><SpecContent>&lt;p&gt;1、被保险人：18-65周岁，身体健康，持有有效驾驶证的驾驶人员； 2、驾驶或乘坐家庭自用车期间的意外伤害医疗：在保险期间内，被保险人遭受主险责任范围内的意外伤害并在中华人民共和国境内（不含港、澳、台地区）二级（含）以上或保险人认可的医疗机构治疗，由此发生符合当地社会基本医疗保险规定可以报销的合理且必要的医疗费用，保险人按“（每次意外合理医疗费用-100元 ）× 80%”给付意外伤害医疗保险金； 3、驾驶或乘坐家庭自用车期间的意外伤害住院津贴：在保险期间内，被保险人遭受主险责任范围内的意外伤害并在中华人民共和国境内（不含港、澳、台地区）二级（含）以上或保险人认可的其它医疗机构住院治疗，保险人按“（每次实际住院天数-3天）×100元”给付住院津贴保险金。单次给付天数最高不超过90天，累计给付天数最高不超过180天； 4、特别提醒：由于机动车超载、超速、超限引起的意外伤害，机动车驾驶员酒后驾驶、无有效驾驶证驾驶或者驾驶无有效行驶证的机动车期间引起的意外伤害，保险人不承担给付保险金责任； 5、适用条款：《交通工具意外伤害保险条款》、《附加意外伤害医疗保险条款》、《附加意外伤害住院津贴保险条款》。&lt;/p&gt;</SpecContent><CoverageList><CoverageItem><CoverageType>1</CoverageType><CoverageCode>YW001001</CoverageCode><CoverageName>交通工具意外伤害保险</CoverageName><LiabilityCode>ZYW0004</LiabilityCode><LiabilityName>交通意外身故/残疾（驾驶非营运性质的机动车）</LiabilityName><PlanCoverageAmount>500000.00</PlanCoverageAmount><CoverageAmount>500000</CoverageAmount></CoverageItem><CoverageItem><CoverageType>1</CoverageType><CoverageCode>YW001001</CoverageCode><CoverageName>交通工具意外伤害保险</CoverageName><LiabilityCode>ZYW0005</LiabilityCode><LiabilityName>交通意外身故/残疾（乘坐非营运性质的机动车）</LiabilityName><PlanCoverageAmount>50000.00</PlanCoverageAmount><CoverageAmount>50000</CoverageAmount></CoverageItem><CoverageItem><CoverageType>0</CoverageType><CoverageCode>JK005001</CoverageCode><CoverageName>附加意外伤害医疗保险</CoverageName><LiabilityCode>ZJK0001</LiabilityCode><LiabilityName>意外医疗</LiabilityName><PlanCoverageAmount>18000.00</PlanCoverageAmount><CoverageAmount>18000</CoverageAmount></CoverageItem></CoverageList></ProjectItem><ProjectItem><ProjectType>1</ProjectType><ProjectCode>YWQGCX04001</ProjectCode><ProjectName>个人驾乘意外伤害保险1</ProjectName><PlanPremium>80.00</PlanPremium><PlanAmount>220000.00</PlanAmount><Amount>220000</Amount><SpecContent>&lt;p&gt;1、驾驶或乘坐家庭自用车期间的意外伤害医疗：在保险期间内，被保险人遭受主险责任范围内的意外伤害并在中华人民共和国境内（不含港、澳、台地区）二级（含）以上或保险人认可的医疗机构治疗，由此发生符合当地社会基本医疗保险规定可以报销的合理且必要的医疗费用，保险人按“（每次意外合理医疗费用 -100元）×80%”给付意外伤害医疗保险金； 2、特别提醒：由于被保险人驾驶机动车超载、超速、超限引起的意外伤害，被保险人酒后驾驶、无有效驾驶证驾驶或者驾驶无有效行驶证的机动车期间引起的意外伤害，保险人不承担给付保险金责任； 3、适用条款：《交通工具意外伤害保险条款》、《附加意外伤害医疗保险条款》。&lt;/p&gt;</SpecContent><CoverageList><CoverageItem><CoverageType>1</CoverageType><CoverageCode>YW001001</CoverageCode><CoverageName>交通工具意外伤害保险</CoverageName><LiabilityCode>ZYW0004</LiabilityCode><LiabilityName>交通意外身故/残疾（驾驶非营运性质的机动车）</LiabilityName><PlanCoverageAmount>200000.00</PlanCoverageAmount><CoverageAmount>200000</CoverageAmount></CoverageItem><CoverageItem><CoverageType>1</CoverageType><CoverageCode>YW001001</CoverageCode><CoverageName>交通工具意外伤害保险</CoverageName><LiabilityCode>ZYW0005</LiabilityCode><LiabilityName>交通意外身故/残疾（乘坐非营运性质的机动车）</LiabilityName><PlanCoverageAmount>200000.00</PlanCoverageAmount><CoverageAmount>200000</CoverageAmount></CoverageItem><CoverageItem><CoverageType>0</CoverageType><CoverageCode>JK005001</CoverageCode><CoverageName>附加意外伤害医疗保险</CoverageName><LiabilityCode>ZJK0001</LiabilityCode><LiabilityName>意外医疗</LiabilityName><PlanCoverageAmount>20000.00</PlanCoverageAmount><CoverageAmount>20000</CoverageAmount></CoverageItem></CoverageList></ProjectItem><ProjectItem><ProjectType>1</ProjectType><ProjectCode>YWQGCX04002</ProjectCode><ProjectName>个人驾乘意外伤害保险1（2份）</ProjectName><PlanPremium>160.00</PlanPremium><PlanAmount>440000.00</PlanAmount><Amount>440000</Amount><SpecContent>1、驾驶或乘坐家庭自用车期间的意外伤害医疗：在保险期间内，被保险人遭受主险责任范围内的意外伤害并在中华人民共和国境内（不含港、澳、台地区）二级（含）以上或保险人认可的医疗机构治疗，由此发生符合当地社会基本医疗保险规定可以报销的合理且必要的医疗费用，保险人按“（每次意外合理医疗费用 -100元）×80%”给付意外伤害医疗保险金；2、特别提醒：由于被保险人驾驶机动车超载、超速、超限引起的意外伤害，被保险人酒后驾驶、无有效驾驶证驾驶或者驾驶无有效行驶证的机动车期间引起的意外伤害，保险人不承担给付保险金责任；3、适用条款：《交通工具意外伤害保险条款》、《附加意外伤害医疗保险条款》。</SpecContent><CoverageList><CoverageItem><CoverageType>1</CoverageType><CoverageCode>YW001001</CoverageCode><CoverageName>交通工具意外伤害保险</CoverageName><LiabilityCode>ZYW0004</LiabilityCode><LiabilityName>交通意外身故/残疾（驾驶非营运性质的机动车）</LiabilityName><PlanCoverageAmount>400000.00</PlanCoverageAmount><CoverageAmount>400000</CoverageAmount></CoverageItem><CoverageItem><CoverageType>1</CoverageType><CoverageCode>YW001001</CoverageCode><CoverageName>交通工具意外伤害保险</CoverageName><LiabilityCode>ZYW0005</LiabilityCode><LiabilityName>交通意外身故/残疾（乘坐非营运性质的机动车）</LiabilityName><PlanCoverageAmount>400000.00</PlanCoverageAmount><CoverageAmount>400000</CoverageAmount></CoverageItem><CoverageItem><CoverageType>0</CoverageType><CoverageCode>JK005001</CoverageCode><CoverageName>附加意外伤害医疗保险</CoverageName><LiabilityCode>ZJK0001</LiabilityCode><LiabilityName>意外医疗</LiabilityName><PlanCoverageAmount>40000.00</PlanCoverageAmount><CoverageAmount>40000</CoverageAmount></CoverageItem></CoverageList></ProjectItem></ProjectACCList></Packet>]]></bizContent></xml>';
        /*** @var NonCarProductListResponse $response */
        $response = $this->execute($request);
        return $response;
//        $response = new NonCarProductListResponse(200);
//        $response->printerInit();
//        return $response;
    }

    public function nonCarInquiry(NonCarInquiryVisitor $nonCarInquiryVisitor)
    {
        // TODO: Implement nonCarUnderwriting() method.
    }

    public function nonCarUnderwriting(NonCarInquiryVisitor $inquiryPrinter)
    {
        // TODO: Implement nonCarUnderwriting() method.
    }
}
